﻿@model Tau.ViewModels.PageList

    <link href="@Url.Content("~/Content/leftnav/styles.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Content/leftnav/jquery.js")" type="text/javascript"></script>

 
    <ul id="sliding-navigation">

        <!--HOME LINK-->
        <li class="sliding-element">
            <h3 style="font-weight:500; cursor:pointer" onclick="location.href='@Url.Action("GetPage", "Page", new { id = 314, area = "" })'">Home</h3>
        </li>

        <!--PRODUCTS LINK-->
        <li class="sliding-element">
            <h3 style="font-weight:500; cursor:pointer" onclick="location.href='@Url.Action("Index", "Products")'">Products</h3>
        </li>

        @{
            var pages = Model.Pages.FindAll(pp => pp.PageId != 314); //exclude HOME

            foreach (var page in pages)
            {

                if (page.ParentPageId > 0)
                {
                    <li class="sliding-element" style="border-top:2px">
                        <a href='@Url.Action("GetPage", "Page", new { id = @page.PageId, area = "" })'>@page.PageName</a>
                    </li>
                }
                else
                {
                    <li class="sliding-element"><h3 style="font-weight:500">@page.PageName</h3></li>
                }
            }
        }
    </ul>